{
  "properties" : { },
  "id" : "0f63dec90121475b87b240b25cd08987",
  "script" : null,
  "groupId" : "4c0c509172534572bbe1809900aeafa9",
  "name" : "复制型号及原型号下边的采集点",
  "createTime" : 1727070995087,
  "updateTime" : 1726305392452,
  "lock" : "1",
  "createBy" : "ndmp",
  "updateBy" : "ndmp",
  "path" : "copy",
  "method" : "POST",
  "parameters" : [ ],
  "options" : [ ],
  "requestBody" : "{\r\n    \"id\": null,\r\n    \"deviceModel\": \"AR2200\",\r\n    \"deviceModelName\": \"AR2200\",\r\n    \"deviceFirm\": \"1\",\r\n    \"originId\": \"1460882810497732610\"\r\n}",
  "headers" : [ ],
  "paths" : [ ],
  "responseBody" : "{\n    \"code\": 500,\n    \"success\": false,\n    \"data\": {},\n    \"msg\": \"系统维护中，请稍后重试。\"\n}",
  "description" : "",
  "requestBodyDefinition" : {
    "name" : "",
    "value" : { },
    "description" : "",
    "required" : false,
    "dataType" : "String",
    "type" : "",
    "defaultValue" : "",
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ ]
  },
  "responseBodyDefinition" : {
    "name" : "",
    "value" : "",
    "description" : "",
    "required" : false,
    "dataType" : "Object",
    "type" : "",
    "defaultValue" : "",
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ {
      "name" : "code",
      "value" : "500",
      "description" : "",
      "required" : false,
      "dataType" : "Integer",
      "type" : "",
      "defaultValue" : "",
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "success",
      "value" : "false",
      "description" : "",
      "required" : false,
      "dataType" : "Boolean",
      "type" : "",
      "defaultValue" : "",
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "data",
      "value" : "",
      "description" : "",
      "required" : false,
      "dataType" : "Object",
      "type" : "",
      "defaultValue" : "",
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "msg",
      "value" : "系统维护中，请稍后重试。",
      "description" : "",
      "required" : false,
      "dataType" : "String",
      "type" : "",
      "defaultValue" : "",
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    } ]
  }
}
================================
import org.apache.commons.lang.StringUtils


var originId = body.originId
var val = db.transaction(()=>{
    var v1 = db.table('ndmp_net_device_model_info').primary('id',IdUtil.getSnowflakeNextId()).save(data,false);

    var list = db.table('ndmp_model_mib_relation').column('mib_id').where().eq(StringUtils.isNotBlank(v1),'device_model_id',originId).select();

    if (list != null && list.size() > 0) {
        for (item in list) {
            item.deviceModelId=v1;
            item.id=IdUtil.getSnowflakeNextId();
            }
        }
    var v3 = db.table('ndmp_model_mib_relation').batchInsert(list);
});

return val;
